<?php

class Web_Svc_ActualizarCarrito {

    public function doIt() {
        $this->actualizarCarrito();
    }

    private function actualizarCarrito() {

        $keys = array_keys($_POST);

//        print_r($keys);print_r($_POST[$keys]);exit ();



        $car = new Ey_Carrito();

        foreach ($keys as $key) {
            if (preg_match('/^(\+|-)?\d+$/', $_POST[$key]) && $_POST[$key] > 0) {
//                $item_id = '[' . $key . ']';

//                $car->updateItem($key,$_POST[$key],$precio,$rsDescuento->des_descuento);

//            echo $key;
//            echo $_POST[$key];
//            echo $_SESSION['eyoriacart'][$key]['item_price'];
//            echo $_SESSION['eyoriacart'][$key]['ext_info'];
//            exit ();

                $car->updateItem($key,
                        $_POST[$key]
//                        $_SESSION['eyoriacart'][$key]['item_price']
                );


            }
        }

        Ey::goBack();
    }

}